#include <stdio.h>

/*判断星期几*/

void main()
{
    char letter;
    int flag=0;
    printf("请输入第一个字母：\n");
    while((letter=getchar())!='Y'||flag==1)
    {
        switch(letter)
        {
            case 'S':printf("请输入第二个字母\n");
                    if((letter=getchar())=='a')
                    printf("saturday!\n");
                    else if((letter=getchar())=='u')
                    printf("sunday!\n");
                    else printf("data error!\n");
                    break;
            case 'M':printf("monday!\n"); break;
            case 'F':printf("friday!\n"); break;
            case 'W':printf("wednesday!\n"); break;
            case 'T':printf("请输入第二个字母\n");
                    if((letter=getchar())=='u')
                    printf("tuesday!\n");
                    else if((letter=getchar())=='h')
                    printf("thursday!\n");
                    else printf("data error!\n");
                    break;
            default:printf("data error!\n"); break;
            flag=1;
        }
    }

}
